# Makefile for python-updater
MAN_INCLUDE=man.include
VERSION=$(shell ./python-updater -V)
FILES=AUTHORS ChangeLog python-updater python-updater.1
PKGDIR=python-updater-$(VERSION)
TARBALL=$(PKGDIR).tar.bz2

all: python-updater.1 tarball

python-updater.1: python-updater $(MAN_INCLUDE)
	help2man -L C -Ni $(MAN_INCLUDE) ./python-updater -o $@
	sed -i -e 's/ in the manpage//' \
		-e 's/\*[[:space:]]\([[:alpha:]]*\).*/\1 /' $@

.PHONY: all clean tarball upload
clean:
	rm -fr python-updater.1 *.bz2 $(PKGDIR) || true
tarball:
	mkdir $(PKGDIR)
	cp $(FILES) $(PKGDIR)
	tar cjf $(TARBALL) $(PKGDIR)
	rm -fr $(PKGDIR)
upload:
	scp $(TARBALL) dev.gentoo.org:/space/distfiles-local
	ssh dev.gentoo.org chmod ug+rw /space/distfiles-local/$(TARBALL)
